<html xmlns:th="http://www.thymeleaf.org">
<link type="text/css" href="/topjui/css/myui.css" rel="stylesheet"/>
<form id="customerform" method="post" style="padding-top:1px">
<input type="hidden" id="id" name="id" value="0">
<table class="editTable">
    <tr>
        <td class="label">用户名称</td>
        <td>
            <input type="text" name="username" autocomplete="off" class="inputp" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">用户昵称</td>
        <td>
            <input type="text" name="nickname" autocomplete="off" class="inputp" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">用户邮箱</td>
        <td>
            <input type="text" name="email" autocomplete="off" class="inputp" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">用户角色</td>
        <td>
            <input type="hidden" name="groupid">
            <input type="hidden" name="groups">
            <input type="text" id="form-group" name="groupid"  class="inputp" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">所属单位</td>
        <td>
            <input type="hidden" class="easyui-validatebox" data-options="required:true" id="form-parentid" name="departid" value="0" >
            <input type="hidden" class="easyui-validatebox" data-options="required:true" id="form-departname" name="departname" value="" >
            <input class="selectp"  type="text" name="depart" id="form-depart">
        </td>
    </tr>
    <tr>
        <td class="label">状态</td>
        <td>
            <select name="status" style="width: 240px;" class="selectp">
                <option value="1">正常</option>
                <option value='0'>禁用</option>
            </select>
        </td>
    </tr>
</table>
    <script th:inline="javascript">
        $(function () {
            $('#form-group').combobox({
                width: 212,
                height: 32,
                valueField: 'id',
                textField: 'name',
                style: "width:212px;height:32px;",
                cls: 'selectp',
                panelWidth: 212,
                hasDownArrow: true,
                url: '/group/all',
                required: true,
                onSelect: function (data) {
                    $("#form-routerid").val(data.id);
                    $("input[name='groupid']").val(data.id);
                    $("input[name='groups']").val(data.name);
                }
            });
            $(".combo-text").removeAttr("style");
            $(".combo-text").attr("style", "width:212px;height:32px;line-height:32px");
            $(".combo-text").addClass("selectp");
            $(".combo-arrow").attr("style", "margin-left: -18px;margin-top: 8px;background-color:rgba(0,0,0,0)");
            $(".combo-panel").attr("style", "margin-top:10px;");

            $('#form-depart').combotree({
                width: 212,
                height: 32,
                style: "width:212px;height:32px;",
                cls: 'selectp',
                panelWidth: 212,
                hasDownArrow: true,
                url: '/depart/tree',
                required: true,
                onSelect: function (data) {
                    $("#form-parentid").val(data.id);
                    $("#form-departname").val(data.text);
                    $("#form-depart").val(data.text);
                }
            });
            $(".combo-text").removeAttr("style");
            $(".combo-text").attr("style", "width:212px;height:32px;line-height:32px");
            $(".combo-text").addClass("selectp");
            $(".combo-arrow").attr("style", "margin-left: -18px;margin-top: 8px;background-color:rgba(0,0,0,0)");
            $(".combo-panel").attr("style", "margin-top:10px;");


        });


    </script>
</form>
</html>